package day18.feifei;

public class MyThread extends Thread{
    @Override
    public void run(){
        for(int i=0;i<50;i++){
            System.out.println(this.getName()+"----"+i);
        }
    }
}
class Test1{
    public static void main(String[] args) throws InterruptedException {
        MyThread m1=new MyThread();//分线程
        MyThread m2=new MyThread();
        MyThread m3=new MyThread();
        m1.start();

        Thread.sleep(5000);
        m2.start();
        m3.start();

        for(int i=0;i<50;i++){
            System.out.println(Thread.currentThread().getName()+"----"+i);
        }
    }
}